//
//  CYYNetWorkManager+User.h
//  LetsPartyBmob
//
//  Created by rimi on 15/9/9.
//  Copyright (c) 2015年 柴阳阳. All rights reserved.
//

#import "CYYNetWorkManager.h"
//登陆成功block
typedef void(^SucessSignIn)(BmobUser *user);

//登陆成功block
typedef void(^SucessGetUserInfo)(BmobObject *bUser);

//登陆成功block
typedef void(^SucessGetUserInfoDict)(NSDictionary *userInfoDict);

//验证成功block
typedef void(^SucessCheck)(NSString *sucessString, BmobUser * bUser);

@interface CYYNetWorkManager (User)
#pragma mark - 用户注册
//注册:参数：姓名，手机号，密码
+ (void)signUpWithName:(NSString *)name
     mobilePhoneNumber:(NSString *)phoneNumber
              password:(NSString *)password
                 email:(NSString *)email
                sucess:(Sucess)sucess
                  fail:(Fail)fail;

#pragma mark - 用户登陆
//登陆:参数：手机号 + 密码
+ (void)signInWithmMobilePhoneNumber:(NSString *)phoneNumber
                            password:(NSString *)password
                        sucessSignIn:(SucessSignIn)sucessSignIn
                                fail:(Fail)fail;


#pragma mark - 获得本地缓存的用户信息
//获取当前登陆的用户:返回值：BombUser
//每次你登录成功，都会在本地磁盘中有一个缓存的用户对象作为当前用户，可以获取这个缓存的用户对象来进行登录：
+ (BmobUser *)currentUserGet;

#pragma mark - 注销登陆：清楚本地缓存的数据
//注销当前登陆
+ (void)signOut;

#pragma mark - 更新用户资料
//更新姓名
+ (void)usernameChangeWithNewUsername:(NSString *)newUsername sucess:(Sucess)sucess fail:(Fail)fail;
//更新手机号
+ (void)mobilePhoneNumberChangeWithNewMobilePhoneNumber:(NSString *)newMobilePhoneNumber sucess:(Sucess)sucess fail:(Fail)fail;
//只更新用户名和手机号
+ (void)updateUserInfoWithNewUsername:(NSString *)newUsername
                 newMobilePhoneNumber:(NSString *)newMobilePhoneNumber
                               sucess:(Sucess)sucess
                                 fail:(Fail)fail;
//更新用户所有信息
+ (void)updateUserInfoWithNewUsername:(NSString *)newUsername
                 newMobilePhoneNumber:(NSString *)newMobilePhoneNumber
                     newFirstPassword:(NSString *)newFirstPassword
                    newSecondPassword:(NSString *)newSecondPassword
                               sucess:(Sucess)sucess
                                 fail:(Fail)fail;
#pragma mark - 修改密码
//修改密码
+ (void)passwordChangeWithNewFirstPassword:(NSString *)newFirstPassword
                         newSecondPassword:(NSString *)newSecondPassword
                                    sucess:(Sucess)sucess
                                      fail:(Fail)fail;
#pragma mark - 忘记密码
+ (void)forgetPasswordWithMobilePhoneNumber:(NSString *)mobilePhoneNumber
                                       name:(NSString *)name
                                     sucess:(SucessCheck)sucess
                                       fail:(Fail)fail;
/**< 第二步 */
//修改密码
+ (void)forgetPasswordSecondChangeWithBmobUser:(BmobUser *)user
                              NewFirstPassword:(NSString *)newFirstPassword
                             newSecondPassword:(NSString *)newSecondPassword
                                        sucess:(Sucess)sucess
                                          fail:(Fail)fail;

//邮箱重置密码
+ (void)changPassworgByEmail:(NSString *)email
                      sucess:(Sucess)sucess
                        fail:(Fail)fail;

#pragma mark - 更具用户的ObjectId获得改用户的基本信息

+ (void)getUserDetailInfoWithOnjectId:(NSString *)objectId
                               sucess:(SucessGetUserInfo)sucess
                                 fail:(Fail)fail;
#pragma mark - 根据用户的ObjectId获得改用户的基本信息《NEW》
+ (void)newGetUserDetailInfoWithOnjectId:(NSString *)objectId
                                  sucess:(SucessGetUserInfoDict)sucess
                                    fail:(Fail)fail;

@end
